package com.dragon.interfaces.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 用户登陆记录
 * </p>
 *
 * @author dragon
 * @since 2024-08-01 18:08:24
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_user_login_log")
public class UserLoginLog implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 访问ID
     */
    @TableId(value = "login_id", type = IdType.AUTO)
    private Long loginId;

    /**
     * 追踪ID
     */
    @TableField("trace_id")
    private String traceId;

    /**
     * 用户账号
     */
    @TableField("account")
    private String account;

    /**
     * 登录IP地址
     */
    @TableField("login_ip")
    private String loginIp;

    /**
     * 登录地点
     */
    @TableField("login_location")
    private String loginLocation;

    /**
     * 浏览器类型
     */
    @TableField("browser")
    private String browser;

    /**
     * 操作系统
     */
    @TableField("os")
    private String os;

    /**
     * 引擎类型
     */
    @TableField("engine")
    private String engine;

    /**
     * 登录状态（1成功 0失败）
     */
    @TableField("status")
    private Byte status;

    /**
     * 提示消息
     */
    @TableField("msg")
    private String msg;

    /**
     * 访问时间
     */
    @TableField("login_time")
    private LocalDateTime loginTime;

    public static final String LOGIN_ID = "login_id";

    public static final String TRACE_ID = "trace_id";

    public static final String ACCOUNT = "account";

    public static final String LOGIN_IP = "login_ip";

    public static final String LOGIN_LOCATION = "login_location";

    public static final String BROWSER = "browser";

    public static final String OS = "os";

    public static final String ENGINE = "engine";

    public static final String STATUS = "status";

    public static final String MSG = "msg";

    public static final String LOGIN_TIME = "login_time";

}
